<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<%@ include file="/web/header.jsp"%>
<title>用户登陆</title>
</head>
<body style="background: #f1f1f1">
	<div class="window">


		<fieldset id="">
			<legend>登陆</legend>
			<div class="layui-field-box">
				<form action="" class="layui-form layui-form-pane" method="post">
					<div class="layui-form-item">
						<label class="layui-form-label">账号</label>
						<div id="" class="layui-input-inline">
							<input type="text" name="code" id="" class="layui-input"
								lay-verify="required" placeholder="请输入账号" />
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">密码</label>
						<div id="" class="layui-input-inline">
							<input type="password" name="password" id="" class="layui-input"
								lay-verify="required" placeholder="请输入密码" />
						</div>
					</div>
					<!-- 					<div class="layui-form-item"> -->
					<!-- 						<label class="layui-form-label">姓名</label> -->
					<!-- 						<div id="" class="layui-input-inline"> -->
					<!-- 							<input type="text" name="name" id="" class="layui-input" -->
					<!-- 								lay-verify="required" placeholder="请输入姓名" /> -->
					<!-- 						</div> -->
					<!-- 					</div> -->
					<div class="layui-form-item">
						<div id="" class="layui-input-inline">
							<input type="button" name="" id="" value="登陆" class="layui-btn"
								lay-submit lay-filter="login" /> <input type="reset" name=""
								id="" value="重置" class="layui-btn layui-btn-primary" />
						</div>
						<input type="button" name="" id="" value="去注册" class="layui-btn"
							onclick="goJspReg()" />
					</div>
					<input type="hidden" name="action" id="" value="login" />
				</form>
			</div>

		</fieldset>
	</div>
	<script type="text/javascript">
		formSubmit('/employee', 'submit(login)', 'text', function(data) {
// 			console.log(data)
			if (data == "unReg") {
				layer.msg("账号未注册")
			} else if (data == "passerror") {
				layer.msg("密码错误")
			}else if(data=="success"){
				layer.msg("登陆成功")
				window.location.href = "/Project1_0820/web/page/index.jsp"
			}
		})

		function goJspReg() {
			window.location.href = "reg.jsp"
		}
	</script>

</body>
</html>